package xyz.sicau.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.sicau.feign.pojo.User;

@Slf4j
@RestController
public class UserController {

    @RequestMapping("/hello")
    public String hello() {
        return "hello!!!";
    }

    @RequestMapping("/user/{id}")
    public User user(@PathVariable int id, @RequestHeader(value = "key", required = false) String key) {
        log.info("user");
        return new User(id, "lsq");
    }
}
